import React, { Component } from "react";
import store from "./store/index.js";

class App extends Component {
  add = () => {
    store.dispatch({ type: "increment" });
    console.log(store.getState());
  };

  render() {
    return (
      <>
        <h2>react结合redux</h2>
        <button>-</button>
        <span>{store.getState().count}</span>
        <button onClick={this.add}>+</button>
      </>
    );
  }
}

export default App;
